import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from "../views/Home.vue";
import MyKind from "../views/MyKind.vue";
import MyMine from "../views/MyMine.vue";
import MyCart from "../views/MyCart.vue";


import Detail from "../views/Detail.vue";
import login from "../views/Login.vue";
import Register from "../views/Register/Register.vue";
import Reg1 from "../views/Register/Reg1.vue";
import Reg2 from "../views/Register/Reg2.vue";
import Reg3 from "../views/Register/Reg3.vue";
import MySearch from "../views/MySearch.vue";
import Footer from "../components/Footer.vue";
import MyOrder from "../components/MyAddress/Order.vue";
import DoBar from "../views/DoBar.vue";
import EditAddress from "../components/MyAddress/EditAddress.vue";
import AddAddress from "../components/MyAddress/AddAddress.vue";
import newAddress from "../components/MyAddress/newAddress.vue";

Vue.use(VueRouter)

const routes = [

  {
    path: '/',
    name: 'home',
    components: {
      default: Home,
      Footer
    }
  },
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
    redirect: "register/one",
    children: [
      {
        path: '/register/one',
        component: Reg1
      },
      {
        path: '/register/two',
        component: Reg2
      },
      {
        path: '/register/treen',
        component: Reg3
      },
    ]
  },
  {
    path: '/detail/:proid',
    name: 'datail',
    component: Detail
  },

  {
    path: '/cant',
    name: 'MyCart',
    components: {
      default: MyCart,
      Footer
    },

  },
  {
    path: '/order',
    name: 'order',
    component: MyOrder,
    redirect: "/order/dobar",
    children: [
      {
        path: '/order/dobar',
        component: DoBar,
      },
      {
        path: '/order/addaddress',
        name: 'AddAddress',
        component: AddAddress,
      },
      {
        path: '/order/editaddress',
        name: 'EditAddress',
        component: EditAddress,
      },
      {
        path: '/order/newAddress',
        name: 'newAddress',
        component: newAddress,
      }

    ]
  }
  //https://wqs.jd.com/order/m.confirm.shtml?pingouchannel=0&taro=1&mix=0&sceneval=2&addrId=4551928385&jxsid=16698778257932161549#/address?id=4217351024&storeId=&select=true&addrAgent=0000000000
  // https://wqs.jd.com/order/m.confirm.shtml?pingouchannel=0&taro=1&mix=0&sceneval=2&addrId=4551928385&jxsid=16698778257932161549#/address/edit?id=4217351024&type=edit&showDefaultSet=false&showDelete=true&confirmText=%E7%A1%AE%E8%AE%A4&containGlobal=false&from=pay&globalBranchName=%E4%BA%AC%E4%B8%9C%E5%9B%BD%E9%99%85&isShowIDCard=false&showAddressTag=true&showEditAddrLocation=true&showOverseas=true&showParseAddress=false&showSniffClip=false&editNavigateBackDelta=2&addrAgent=0000000000&__state__=3
,
  {
    path: '/kind',
    name: 'MyKind',
    components: {
      default: MyKind,
      Footer
    }
  },
  {
    path: '/my',
    name: 'MyMine',
    components: {
      default: MyMine,
      Footer
    }
  },
  {
    path: '/search',
    name: 'MySearch',
    component: MySearch
  },
]

const router = new VueRouter({
  routes
})

export default router
